let visitModule = (function(){
    let $tbody = $('.tableBox').find('tbody');
    let customerId = null;
    async function bindHTML(){
        let str = '';
        // 获取回访记录信息
        let result = await axios.get('/visit/list',{
            params:{
                customerId
            }
        })
        if(result.code == 0){
            result.data.forEach(item=>{
                let {
                    id,
                    customerId,
                    customerName,
                    visitText,
                    visitTime
                } = item;
                str +=`<tr>
                <td class="w5">${id}</td>
                <td class="w15">${visitTime}</td>
                <td class="w70 wrap">${visitText}</td>
                <td class="w10">
                    <a href="javascript:;" id=${customerId}>删除</a>
                </td>
                </tr> `
            })   
            $tbody.append(str)
        }
    }
    return {
        init(){
            // 获取到传递的客户id，从而获取客户的基本信息
            let params = window.location.href.queryUrlParams();
            customerId = params.id;
            bindHTML();
        }
    }
}())
visitModule.init();